/**
 * 
 */
package org.istt.service.impl;

import org.istt.dao.MenuTreeDao;
import org.istt.domain.Menu;
import org.istt.domain.MenuTree;
import org.istt.service.MenuTreeManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author NDTHO
 *
 */
@Service("menuTreeManager")
public class MenuTreeManagerImpl extends ManagerImpl<MenuTree, Long> implements MenuTreeManager {
	@Autowired
	MenuTreeDao menuTreeDao;
	
	public MenuTreeDao getMenuTreeDao() {
		return menuTreeDao;
	}

	public void setMenuTreeDao(MenuTreeDao menuTreeDao) {
		this.menuTreeDao = menuTreeDao;
	}

	@Override
	public Menu getMenuTreeById(String menuId) {
		
		return null;
	}

	@Override
	public void saveMenuTree(MenuTree menu) {
		
		this.menuTreeDao.saveMenuTree(menu);
	}

	@Override
	public void removeMenuTree(String menuId) {
		
		this.menuTreeDao.removeEntityByChildMenu(Long.parseLong(menuId));
	}

	@Override
	public Menu getFatherMenu(String menuId) {
		
		return this.menuTreeDao.getFatherMenu(Long.parseLong(menuId));
	}
}
